#region File Description
//-----------------------------------------------------------------------------
// ProjectileTrailParticleSystem.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace mirror
{
    /// <summary>
    /// Custom particle system for leaving smoke trails behind the rocket projectiles.
    /// </summary>
    class ProjectileTrailParticleSystem3D : ParticleSystem3D
    {
        public ProjectileTrailParticleSystem3D()
        { }


        protected override void InitializeSettings(ParticleSettings3D settings)
        {
            settings.TextureName = "particles3d/smoke";

            settings.MaxParticles = 1000;


            float multiplier = 1.0f;
            float durationMultiplier = 1.0f;

            settings.Duration = TimeSpan.FromSeconds(3 * durationMultiplier);

            settings.DurationRandomness = 1.5f;

            settings.EmitterVelocitySensitivity = 0.1f;

            settings.MinHorizontalVelocity = 0 * multiplier;
            settings.MaxHorizontalVelocity = 1 * multiplier;

            settings.MinVerticalVelocity = -1 * multiplier;
            settings.MaxVerticalVelocity = 1 * multiplier;

            settings.MinColor = new Color(64, 96, 128, 255);
            settings.MaxColor = new Color(255, 255, 255, 128);

            settings.MinRotateSpeed = -4;
            settings.MaxRotateSpeed = 4;

            settings.MinStartSize = 2 * multiplier;
            settings.MaxStartSize = 4 * multiplier;

            settings.MinEndSize = 5 * multiplier;
            settings.MaxEndSize = 15 * multiplier;
        }
    }
}
